<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
  <title>Euskalbar: Morris</title>
  <script type="text/javascript">
  function getParam(name) {
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp(regexS);
    var tmpURL = window.location.href;
    var results = regex.exec(tmpURL);
    if(results == null)
     return "";
    else
     return results[1];
  }

  function createForm() {
    // Parametroak jaso aldagaietan
    var hizk = getParam('hizkuntza');
    var hitza = getParam('hitza');

    // Inprimakia sortu eta atributuak esleitu
    var form = document.createElement('form');
    form.setAttribute("method", "post");
    form.setAttribute("action", "http://www1.euskadi.net/morris/resultado.asp");

    // hidden motako input bat sortu eta atributuak esleitu
    var input = document.createElement('input');
    input.setAttribute("type", "hidden");
    input.setAttribute("name", hizk);
    input.setAttribute("id", hizk);
    input.setAttribute("value", hitza);

    // Sortutako elementuak dokumentuari erantsi
    form.appendChild(input);
    document.body.appendChild(form);
  }
  </script>
</head>

<body onload="createForm(),document.forms[0].submit()">
</body>
</html>
